#include "form.h"
#include "ui_form.h"
#include<qrect.h>
#include<qtimer.h>
#include<QKeyEvent>
#include<QDebug>
#include<QFont>
#include<QPixmap>
#include<QMovie>
#include<widget.h>
#include<QBitmap>
#include<guize.h>

int  turnon=0;
Form::Form(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::Form)
{
    ui->setupUi(this);
    this->setGeometry(QRect(200,200,800,310));
    this->resize( QSize( 670, 350));   //调整对话框初始大小
}

Form::~Form()
{
    delete ui;
}


void Form::paintEvent(QPaintEvent *event){
    QPainter painter(this);


    painter.drawRect(0,0,670,350);
    painter.drawPixmap(0,0,670,350,QPixmap(":/myimg/picture/123.png"));


    ui->pushButton_2->setStyleSheet(tr("background-image: url(:/myimg/picture/22222.png);"));
    ui->pushButton_2->setFixedSize(QPixmap(":/myimg/picture/22222.png").size());
    ui->pushButton_2->setMask(QPixmap(":/myimg/picture/22222.png").mask());

    ui->pushButton_3->setStyleSheet(tr("background-image: url(:/myimg/picture/65656.png);"));
    ui->pushButton_3->setFixedSize(QPixmap(":/myimg/picture/65656.png").size());
    ui->pushButton_3->setMask(QPixmap(":/myimg/picture/65656.png").mask());

    ui->pushButton->setStyleSheet(tr("background-image: url(:/myimg/picture/888.png);"));
    ui->pushButton->setFixedSize(QPixmap(":/myimg/picture/888.png").size());
    ui->pushButton->setMask(QPixmap(":/myimg/picture/888.png").mask());

    ui->pushButton_4->setStyleSheet(tr("background-image: url(:/myimg/picture/7777.png);"));
    ui->pushButton_4->setFixedSize(QPixmap(":/myimg/picture/7777.png").size());
    ui->pushButton_4->setMask(QPixmap(":/myimg/picture/7777.png").mask());
}





void Form::on_pushButton_2_clicked(bool checked)
{
    widget *k=new widget;
    k->show();

}


void Form::on_pushButton_4_clicked()
{
    guize *i=new guize;
    i->show();

}

